﻿<%@ Page Language="C#" MasterPageFile="~/member/UserManage.master" AutoEventWireup="true"
    CodeFile="LinkEdit.aspx.cs" Inherits="member_Link_LinkEdit" Title="友情链接管理" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContInfo" runat="Server">
       <div class="inkg mar_top">
        <strong class="inkgt">
            友情连接编辑</strong>
           <table border="0" cellpadding="0" cellspacing="0" class="addtb">
            <thead>
                <tr>
                    <td colspan="2">
                        友情连接编辑
                    </td>
                </tr>
            </thead>
            <tbody>
            <tr>
                <td width="16%" class="tblt">
                    链接标题：
                </td>
                <td >
                    <asp:TextBox ID="txtName" runat="server" Width="200px"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td class="tblt">
                    链接地址：
                </td>
                <td >
                    <asp:TextBox ID="txtUrl" runat="server" Width="200px"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td class="tblt">
                    网站Logo：
                </td>
                <td >
                    <asp:HiddenField ID="ImgUrl1" runat="server" />
                    <a href="" id="txturldz" target="_blank">
                        <img border="0" src="../../Images/System/wutu.gif" id="ImgUrl" alt="" runat="server"
                            style="width: 106px; height: 95px" /></a><br />
                    <input id="txtupload" type="button" value="上传" onclick="return rowTest()" /><br />
                    <div id="rowTest" style="display: none">
                        <iframe name="tag" src="../Tool/Upload.html" style="width: 550px; height: 120px"
                            frameborder="0" scrolling="no" onload="this.height=tag.document.body.scrollHeight">
                        </iframe>
                    </div>
                </td>
            </tr>
            <tr>
                <td align="center" colspan="2" height="40">
                    <asp:Button ID="btnSave" runat="server" Text="保存" OnClick="btnSave_Click" CssClass="i_button" />
                    <asp:Button ID="btnBack" runat="server" Text="返回" OnClick="btnBack_Click" CssClass="i_button" />
                </td>
            </tr>
            </tbody>
        </table>
    </div>

    <script type="text/javascript" src="../../JS/Common.js"> </script>

    <script type="text/javascript">
    $("ctl00_ContInfo_btnSave").onclick=function()
    {
    if( $("ctl00_ContInfo_txtName").value.replace(/\s/g,'')=="")
      {
      alert( "链接标题不能为空!")
      $("ctl00_ContInfo_txtName").focus();
      return false;
      }
     if($("ctl00_ContInfo_txtUrl").value.replace(/\s/g,'')=="")
      {
         alert("链接地址不能为空!")
         $("ctl00_ContInfo_txtUrl").focus();
         return false
      }else{
         var urlreg=/http(s)?:\/\/([\w-]+\.)+[\w-]+(\/[\w- .\/?%&=]*)?/
         var url=$("ctl00_ContInfo_txtUrl").value.replace(/\s/g,'');
         if (!urlreg.test(url))
         {
             alert("链接地址格式不合法!")
             $("ctl00_ContInfo_txtUrl").focus();
             return false
         }
      }
      if(FileUPload(2)!=0)
      {
        alert("图片上传不能空!");
        return false;
      }
     
    }
    </script>

</asp:Content>
